﻿@{
    ViewBag.Title = "用户列表";
    Layout = "~/Views/Shared/_LayoutList.cshtml"; 
}
@(      
 Html.DWZGridFor<UserInfo>()
    .Action(@Url.Action("OrgUserList"))
    .Height("document.documentElement.clientHeight-86")
    .ExtParam(new { ParentId = @ViewBag.OrgId })
    .Columns(col =>
    {
        col.Bind(e => e.Id).IsKey();
        col.Bind(e => e.UserCode).Width(80).AsQuery();
        col.Bind(e => e.UserName).Width(100).AsQuery();
        col.Bind(e => e.AccountState).EnumKey("AccountState").Width(60);
        col.Bind(e => e.SeqNo).Width(60);
        col.Bind(e => e.UpdateUser).Width(60);
        col.Bind(e => e.UpdateDate).Width(70).DateFormat("yyyy-MM-dd");
        col.Bind(e => e.Id, "操作", 80).Sortable(false)
                .Template(Url.EditLink("EditUser", "编辑用户"));
    })
    .Buttons(btn =>
    {
        btn.Bind("Add", "新建用户", FlexiGridButtonType.Add).OnPress("AddUser");
    })
)
@Html.Css("dailog")
@Html.Js("dailog")
<script type="text/javascript">
    // 添加用户信息
    function AddUser(id) {
        var url = '@Url.Action("EditUser", new { ParentId = @ViewBag.OrgId })';
        OpenModelWindow(url, { width: 470, height: 330, caption: "添加用户信息", onclose: refreshGrid });
        return false;
    }
</script>
